home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / MEMORY / OLD / MEM208SRC / FSLib / c / command < prev    next >
Text File  |  1993-08-22  |  706b  |  31 lines

  1. /* Original code (c) Acorn Computers Ltd, 1992-3 */
  2.  
  3. #include "FS.h"
  4.  
  5. /*{{{  */ _kernel_oserror *fs_command(char *arg_string,int argc,int cmd_no,void *privw) /*command processor*/
  6. {
  7. #define buf_Len 256
  8.   static  char buf[ buf_Len ];
  9.   char *temptr = buf;
  10.   char *argv[20];
  11.   int c=1,f=0;
  12.   argc = argc;
  13.   privw = privw;
  14.   for ( ; temptr - buf < buf_Len && *arg_string >= ' ' ; )
  15.   { if (f)
  16.     {
  17.       if (*arg_string==' ')
  18.         *temptr++=0,arg_string++,f=0;
  19.       else
  20.         *temptr++ = *arg_string++;
  21.     }
  22.     else
  23.     { if (*arg_string==' ')
  24.         arg_string++;
  25.       else
  26.         argv[c++]=temptr,*temptr++=*arg_string++,f=1;
  27.   } }
  28.   *temptr = '\0';
  29.   return DoCommand( cmd_no, argc, argv );
  30. }
  31.